#ifndef WF_MODIFYTRIM_H
#define WF_MODIFYTRIM_H

#include "pf_previewactioninterface.h"
#include "pf_modification.h"
#include "gui_export.h"

/**
 * This action class can handle user events to trim entities.
 *
 */
class GUI_EXPORT WF_ModifyTrim : public PF_PreviewActionInterface {
	Q_OBJECT
public:
    /**
     * Action States.
     */
    enum Status {
        ChooseLimitEntity,     /**< Choosing the limiting entity. */
        ChooseTrimEntity       /**< Choosing the entity to trim. */
    };

public:
    WF_ModifyTrim(PF_Container& container,
                        PF_GraphicView& graphicView,
						bool both=false);
    ~WF_ModifyTrim() {}
	
	static QAction* createGUIAction(LX_Define::ActionType /*type*/, QObject* /*parent*/);

    virtual void init(int status=0);
    virtual void trigger();
    virtual void mouseMoveEvent(PF_MouseEvent* e);
    virtual void mouseReleaseEvent(PF_MouseEvent* e);
    virtual void updateMouseButtonHints();
    virtual void updateMouseCursor();
    virtual void updateToolBar();

private:
    PF_Entity* limitEntity;
	PF_Vector limitCoord;
    PF_Entity* trimEntity;
	PF_Vector trimCoord;
	bool both;
};

#endif
